{% extends 'base.html' %}

{% block lis-main %}

    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-3 col-md-2 sidebar">
                <ul class="nav nav-sidebar">
                    <li><a href="/lis_cls/">班级列表</a></li>
                    <li class="active"><a href="/lis_stu/">学生列表</a></li>
                    <li><a href="/lis_tec/">教师列表</a></li>
                </ul>

            </div>
            <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
                <h1 class="page-header">学生列表<span style="position: absolute; right: 200px" class="pull-right"><a
                        class="btn btn-success" href="/add_stu/">新增</a></span></h1>

                <div class="panel panel-success">
                    <div class="panel-body">

                        <table class="table table-bordered">
                            <thead>
                            <tr>
                                <th>序号</th>
                                <th>id</th>
                                <th>name</th>
                                <th>班级</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {% for s in stu %}
                                <tr>
                                    <td>{{ forloop.counter }}</td>
                                    <td>{{ s.id }}</td>
                                    <td>{{ s.name }}</td>
                                    <td>
                                        {{ s.class1.name }}
                                    </td>
                                    <td>
                                        <a href="/del_stu/?id={{ s.id }}" class="btn btn-danger">删除</a>
                                        <a href="/edit_stu/?id={{ s.id }}" class="btn btn-success">编辑</a>
                                    </td>
                                </tr>
                            {% endfor %}
                            </tbody>
                        </table>
                    </div>
                </div>

            </div>
        </div>
    </div>
{% endblock %}